<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>root</title>
    <link href="../../images/logo-icon.svg" rel="icon" type="image/svg">
    <script>var pathToRoot = "../../";</script>
    <script>const storage = localStorage.getItem("dokka-dark-mode")
const savedDarkMode = storage ? JSON.parse(storage) : false
if(savedDarkMode === true){
    document.getElementsByTagName("html")[0].classList.add("theme-dark")
}</script>
<script type="text/javascript" src="../../scripts/sourceset_dependencies.js" async="async"></script>
<link href="../../styles/style.css" rel="Stylesheet">
<link href="../../styles/jetbrains-mono.css" rel="Stylesheet">
<link href="../../styles/main.css" rel="Stylesheet">
<link href="../../styles/prism.css" rel="Stylesheet">
<link href="../../styles/logo-styles.css" rel="Stylesheet">
<script type="text/javascript" src="../../scripts/clipboard.js" async="async"></script>
<script type="text/javascript" src="../../scripts/navigation-loader.js" async="async"></script>
<script type="text/javascript" src="../../scripts/platform-content-handler.js" async="async"></script>
<script type="text/javascript" src="../../scripts/main.js" defer="defer"></script>
<script type="text/javascript" src="../../scripts/prism.js" async="async"></script>
</head>
<body>
<div class="navigation-wrapper" id="navigation-wrapper">
    <div id="leftToggler"><span class="icon-toggler"></span></div>
    <div class="library-name">
            <a href="../../index.html">
                    <span>TeamCity Kotlin DSL</span>
            </a>
    </div>
    <div>
    </div>
    <div class="pull-right d-flex">
        <button id="theme-toggle-button"><span id="theme-toggle"></span></button>
        <div id="searchBar"></div>
    </div>
</div>
<div id="container">
    <div id="leftColumn">
        <div id="sideMenu"></div>
    </div>
    <div id="main">
<div class="main-content" id="content" pageIds="TeamCity Kotlin DSL::jetbrains.buildServer.configs.kotlin/VcsSettings/root/#jetbrains.buildServer.configs.kotlin.VcsRoot#kotlin.Array[kotlin.String]/PointingToDeclaration//1411724783">
  <div class="breadcrumbs"><a href="../../index.html">TeamCity Kotlin DSL</a><span class="delimiter">/</span><a href="../index.html">jetbrains.buildServer.configs.kotlin</a><span class="delimiter">/</span><a href="index.html">VcsSettings</a><span class="delimiter">/</span><a href="root.html">root</a></div>
  <div class="cover ">
    <h1 class="cover"><span><span>root</span></span></h1>
  </div>
  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="root.html"><span class="token function">root</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">root<span class="token operator">: </span><a href="../vcs-root/index.html">VcsRoot</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">vararg </span>rules<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></span></span><span class="token punctuation">)</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">Attaches the specified VCS root with the given <a href="https://www.jetbrains.com/help/teamcity/vcs-checkout-rules.html">checkout rules</a> to a template or buildType</p><p class="paragraph"><strong>Example</strong>. Add Git VCS Root.</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">project {<br>    // ...<br>    vcsRoot(MyVcsRoot)<br><br>    buildType{<br>        id = &quot;MyBuild&quot;<br>        name = &quot;MyBuild&quot;<br><br>        vcs {<br>            root(MyVcsRoot)<br>        }<br>        // ...<br>    }<br>}<br><br>object MyVcsRoot: GitVcsRoot({<br>    name = &quot;My project main repository&quot;<br>    url = &quot;&lt;repository URL&gt;&quot;<br>    branch = &quot;refs/heads/main&quot;<br>    checkoutPolicy = AgentCheckoutPolicy.USE_MIRRORS<br>    authMethod = uploadedKey {<br>        uploadedKey = &quot;&lt;SSH key name&gt;&quot;<br>    }<br>})</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h2 class="">See also</h2><div data-togglable="See also"><div class="table" data-togglable="See also"><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><a href="../vcs-root/index.html"><span>jetbrains.</span><wbr></wbr><span>build</span><wbr></wbr><span>Server.</span><wbr></wbr><span>configs.</span><wbr></wbr><span>kotlin.</span><wbr></wbr><span>VcsRoot</span></a></div></span></div><div><div class="title"><div data-togglable="See also"></div></div></div></div></div></div></div><h2 class="">Parameters</h2><div data-togglable="Parameters"><div class="table" data-togglable="Parameters"><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span><span>root</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">VCS root</p></div></div></div></div></div><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span><span>rules</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph"><a href="https://www.jetbrains.com/help/teamcity/vcs-checkout-rules.html">checkout rules</a>, omit if you want to checkout the entire repository</p></div></div></div></div></div></div></div><br><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="root.html"><span class="token function">root</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">rootId<span class="token operator">: </span><a href="../id/index.html">Id</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">vararg </span>rules<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></span></span><span class="token punctuation">)</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">Attaches a VCS root with the specified id with the given <a href="https://www.jetbrains.com/help/teamcity/vcs-checkout-rules.html">checkout rules</a> to a template or buildType. This method can be used to attach a VCS root which is not defined in Kotlin.</p><h2 class="">Parameters</h2><div data-togglable="Parameters"><div class="table" data-togglable="Parameters"><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span>root</span><wbr></wbr><span><span>Id</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">VCS root id</p></div></div></div></div></div><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span><span>rules</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph"><a href="https://www.jetbrains.com/help/teamcity/vcs-checkout-rules.html">checkout rules</a>, omit if you want to checkout the entire repository</p></div></div></div></div></div></div></div></div></div>
</div>
        <div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2023 Copyright</span><span
                class="pull-right"><span>Generated by </span><a
                href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span>
        </div>
    </div>
</div>
</body>
</html>
